Importing the Northwind Access Database into MySQL
Description
A step-by-step tutorial for importing the Northwind Access Database into MySQL.
Discussion
The Northwind database is a Microsoft Access database that ships with Alpha Anywhere. In order to perform CRUD (Create, Read, Update, Delete) operations on the Northwind Access database, the database must be copied to a directory where you have read/write access or converted to another database format. The Northwind Access database can be found inside the MDBFiles directory in your Alpha Anywhere installation. Your Alpha Anywhere install is typically located at C:\Program Files (x86)\a5v12. In this tutorial, you will learn how to convert the Northwind Access database to a MySQL database.
Download the northwindmysql.zip file and extract its contents somewhere on your computer. The .zip contains the Northwind Access database in a self-contained SQL file named "northwindmysql.sql".
Open MySQL Workbench. Under Management, open the Data Import/Restore tool.
On the Import from Disk tab, select Import from Self-Contained File. Use the browse button to select the northwindmysql.sql file you extracted from the download in the first step.
Select the Default Target Schema:. The northwindmysql.sql file does not have a target schema. Use the New button to create a new target schema named "northwind".
Click the Start Import button to import the Northwind database into the selected target schema. The Import Progress tab will display the progress of the import.
You should now see a list of tables in the northwind schema. The Northwind database is now imported into MySQL.
Build a MySQL Connection String
Now that the Northwind database has been imported into MySQL, the next step is to create a Connection String to the database.
From the Web Projects Control Panel, select [ManageConnStr] Manage Connection Strings > Alpha DAO Connection strings from the Edit menu to create a new connection string.
Click the New button to create a new connection string. Type in "Northwind" for the Connection Name and click the Build button to construct the Connection String.
Select MySQL from the list of options in the Select an API window and click OK.
Configure the MySQL Options for the connection. Choose the Version of MySQL that is installed.
Enter "localhost" in Hostname. If the MySQL database is hosted on another computer, enter the host IP address. For example, 127.0.0.1.
Enter the MySQL Port number. The default port number for a typical MySQL installation is "3306".
Enter the User for accessing the MySQL database. On your development machine, this can be "root" or a user account you created.
Enter the password for the User account specified.
Verify the connection to MySQL is correct by clicking the Test Connection button. You should see a success message. If you receive an error message, verify the Hostname, Port, User, and Password are correct.
Select the MySQL Northwind database you created from the Database list. If Database does not have any options, click the Refresh button. If it still does not list any databases, verify the User you have chosen has access to the MySQL Northwind database.
Click OK to create the MySQL connection string.
Click OK to save the new Northwind connection string.
Click the Close button to exit the AlphaDAO Connections dialog. You can now build a mobile or web application that communicates with the Northwind MySQL database. Click here for a list of tutorials that use the Northwind database.
See Also